package com.ruoyi.web.controller.system;

import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.AdminFlowingStatic;
import com.ruoyi.system.service.IAdminFlowingStaticService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 玩家流水统计Controller
 * 
 * @author ruoyi
 * @date 2020-11-18
 */
@RestController
@RequestMapping("/system/adminStatic")
public class AdminFlowingStaticController extends BaseController
{
    @Autowired
    private IAdminFlowingStaticService adminFlowingStaticService;

    /**
     * 查询玩家流水统计列表
     */
    @PreAuthorize("@ss.hasPermi('system:adminStatic:list')")
    @GetMapping("/list")
    public TableDataInfo list(AdminFlowingStatic adminFlowingStatic)
    {
        startPage();
        List<AdminFlowingStatic> list = adminFlowingStaticService.selectAdminFlowingStaticList(adminFlowingStatic);
        return getDataTable(list);
    }

    /**
     * 导出玩家流水统计列表
     */
    @PreAuthorize("@ss.hasPermi('system:adminStatic:export')")
    @Log(title = "玩家流水统计", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(AdminFlowingStatic adminFlowingStatic)
    {
        List<AdminFlowingStatic> list = adminFlowingStaticService.selectAdminFlowingStaticList(adminFlowingStatic);
        ExcelUtil<AdminFlowingStatic> util = new ExcelUtil<AdminFlowingStatic>(AdminFlowingStatic.class);
        return util.exportExcel(list, "adminStatic");
    }

    /**
     * 获取玩家流水统计详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:adminStatic:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(adminFlowingStaticService.selectAdminFlowingStaticById(id));
    }

    /**
     * 新增玩家流水统计
     */
    @PreAuthorize("@ss.hasPermi('system:adminStatic:add')")
    @Log(title = "玩家流水统计", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody AdminFlowingStatic adminFlowingStatic)
    {
        return toAjax(adminFlowingStaticService.insertAdminFlowingStatic(adminFlowingStatic));
    }

    /**
     * 修改玩家流水统计
     */
    @PreAuthorize("@ss.hasPermi('system:adminStatic:edit')")
    @Log(title = "玩家流水统计", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody AdminFlowingStatic adminFlowingStatic)
    {
        return toAjax(adminFlowingStaticService.updateAdminFlowingStatic(adminFlowingStatic));
    }

    /**
     * 删除玩家流水统计
     */
    @PreAuthorize("@ss.hasPermi('system:adminStatic:remove')")
    @Log(title = "玩家流水统计", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(adminFlowingStaticService.deleteAdminFlowingStaticByIds(ids));
    }
}
